import torch

a = torch.rand(2, 3)
b = torch.rand(2, 3)

print(a) # ==> tensor([[0.8716, 0.3201, 0.2563],[0.3076, 0.0869, 0.1518]])
print(b) # ==> tensor([[0.3327, 0.4069, 0.2908],[0.5719, 0.2851, 0.4897]])

print(torch.sort(a, dim=0, descending=True)) 
# ==>
# torch.return_types.sort(
# values=tensor([[0.8716, 0.3201, 0.2563],[0.3076, 0.0869, 0.1518]]),
# indices=tensor([[0, 0, 0],[1, 1, 1]]))

'''dim=0 按行方向排序 dim=1 按列方向排序'''
'''descending=True 升序 False 降序'''
'''value=值 indices=索引 '''